<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <!-- Bootstrap 3.3.6 -->
    <link rel="stylesheet" th:href="@{/AdminLTE/bootstrap/css/bootstrap.min.css}">
    <!-- jQuery 2.2.3 -->
    <script th:src="@{/AdminLTE/plugins/jQuery/jquery-2.2.3.min.js}"></script>
    <!-- Bootstrap 3.3.6 -->
    <script th:src="@{/AdminLTE/bootstrap/js/bootstrap.min.js}"></script>
    <!-- Theme style -->
    <link rel="stylesheet" th:href="@{/AdminLTE/dist/css/AdminLTE.min.css}">
    <!-- layui -->
    <link rel="stylesheet" th:href="@{/layui/css/layui.css}">
    <!-- layui -->
    <script th:src="@{/layui/layui.js}"></script>
    <!--email-->
    <script th:src="@{/js/tool/email.js}"></script>
</head>
<body>
<!-- Content Header (Page header) -->
<section class="content-header">
    <h1>
        系统管理
        <small>发送邮件</small>
    </h1>
    <ol class="breadcrumb">
        <li><a href="#"><i class="fa fa-dashboard"></i> 主页</a></li>
        <li class="active">系统管理</li>
    </ol>
</section>

<div style="margin-top: 15px;margin-left: 10px;">
    <div>
        <button shiro:hasPermission="emailLog:look" type="button" class="layui-btn layui-btn-sm layui-btn-normal" data-toggle="modal" data-target="#EmailLogModel">
            发送记录
        </button>
        <button type="button" class="layui-btn layui-btn-sm layui-btn-danger" onclick="window.location.reload();">
            刷新页面
        </button>
    </div>
</div>

<script type="text/html" id="emailToolbar">
    <div class="layui-btn-container">
        <button shiro:hasPermission="emailLog:delete" class="layui-btn layui-btn-sm layui-btn-danger" lay-event="batchDelEmail">批量删除</button>
    </div>
</script>

<script type="text/html" id="emailBar">
    <a shiro:hasPermission="emailLog:delete" class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
</script>

<div style="margin-top: 15px; padding: 10px; background-color: #F2F2F2;">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card">
                <div class="layui-card-header">
                    <b style="font-size: 20px">在线发送邮件</b>
                </div>
                <div class="layui-card-body">
                    <form id="emailFromId" class="layui-form" enctype="multipart/form-data">
                        <div class="layui-form-item">
                            <label class="layui-form-label">标题</label>
                            <div class="layui-input-block">
                                <input type="text" name="title" required  lay-verify="required" placeholder="请输入邮件标题，如：写给lzhpo的一封信" autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">发件人</label>
                            <div class="layui-input-block">
                                <input type="text" name="nickName" required  lay-verify="required" placeholder="请输入自定义发件人昵称，如：会打篮球的程序猿" autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label class="layui-form-label">收件人</label>
                            <div class="layui-input-block">
                                <input type="text" name="acceptEmail" required lay-verify="email" placeholder="请输入收件人邮箱，如：lzhpo@qq.com" autocomplete="off" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item layui-form-text">
                            <label class="layui-form-label">内容</label>
                            <div class="layui-input-block">
                                <textarea class="layui-textarea layui-hide" required lay-verify="required" name="content" id="LAY_demo_editor"></textarea>
                            </div>
                        </div>
                        <div class="layui-form-item" style="text-align: right;">
                            <div class="layui-input-block">
                                <button type="reset" class="layui-btn layui-btn-danger">重置</button>
                                <button type="button" class="layui-btn layui-btn-normal" onclick="sendEmail()">发送</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>

<!--发送记录模态框start-->
<div id="EmailLogModel" class="modal fade bs-example-modal-lg" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel">
    <div class="modal-dialog modal-lg" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="myLargeModalLabel">发送历史</h4>
            </div>
            <div class="demoTable" style="margin-left: 10px;">
                搜索邮件内容：
                <div class="layui-inline">
                    <input type="text" class="layui-input" name="content" id="emailContentReload" autocomplete="off">
                </div>
                <button class="layui-btn layui-btn-normal" id="contentSearch" data-type="reload">搜索</button>
            </div>
            <table class="layui-hide" id="emailTable" lay-filter="emailTableFilter"></table>
            <div class="modal-footer">
                <button type="button" class="layui-btn" data-dismiss="modal">关闭</button>
            </div>
        </div>
    </div>
</div>
<!--发送记录模态框end-->

</body>
</html>